
/*
使用let 在ios10以下版本会报错
* */
var hkNativeDevice = (function () {

    var camera = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "camera",
            data: data,
            callback: callback,
        });
    };
    var album = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "album",
            data: data,
            callback: callback
        });
    };
    var location = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "location",
            data: data,
            callback: callback
        });
    };
    var dial = function (data,callback) {

        window.hkJSBridge.call({
            target: "Device",
            action: "dial",
            data: data,
            callback: callback
        });
    };
    var deviceInfo = function (data,callback) {
        window.hkJSBridge.call({
            target: "Device",
            action: "deviceInfo",
            data: data,
            callback: callback
        });
    };

    return{
        camera:camera,
        album:album,
        location:location,
        dial:dial,
        deviceInfo:deviceInfo
    }
})();


var hkNativePage = (function () {

    var openPage = function (data,callback) {

        window.hkJSBridge.call({
            target: "Page",
            action: "openPage",
            data: data,
            callback: callback
        });
    };
    var closePage = function (data,callback) {

        window.hkJSBridge.call({
            target: "Page",
            action: "closePage",
            data: data,
            callback: callback
        });
    };

    return{
        openPage:openPage,
        closePage:closePage
    }
})();


var hkNativeStore = (function () {

    var save = function (data,callback) {

        window.hkJSBridge.call({
            target: "Store",
            action: "save",
            data: data,
            callback: callback
        });
    };
    var get = function (data,callback) {

        window.hkJSBridge.call({
            target: "Store",
            action: "get",
            data: data,
            callback: callback
        });
    };
    var del = function (data,callback) {

        window.hkJSBridge.call({
            target: "Store",
            action: "del",
            data: data,
            callback: callback
        });
    };

    return{
        save:save,
        get:get,
        del:del
    }
})();


var hkNativeHttp = (function () {

    var get = function (data,callback) {

        window.hkJSBridge.call({
            target: "Http",
            action: "get",
            data: data,
            callback: callback
        });
    };
    var post = function (data,callback) {

        window.hkJSBridge.call({
            target: "Http",
            action: "post",
            data: data,
            callback: callback
        });
    };

    return{
        get:get,
        post:post
    }
})();


var hkNativeScan = (function () {

    var barCode = function (data,callback) {
        window.hkJSBridge.call({
            target: "Scan",
            action: "barCode",
            data: data,
            callback: callback
        });
    };

    return{
        barCode:barCode
    }
})();


var hkNativeBocr = (function () {

    var rec = function (data,callback) {

        window.hkJSBridge.call({
            target: "Bocr",
            action: "rec",
            data: data,
            callback: callback
        });
    };

    return{
        rec:rec
    }
})();
var hkNativeBaudio = (function () {

    var rec = function (data,callback) {

        window.hkJSBridge.call({
            target: "Baudio",
            action: "rec",
            data: data,
            callback: callback
        });
    };

    return{
        rec:rec
    }
})();


var hkNativeMedia = (function () {

    var classify = function (data,callback) {

        window.hkJSBridge.call({
            target: "Media",
            action: "classify",
            data: data,
            callback: callback
        });
    };

    return{
        classify:classify
    }
})();




// module.exports = {
//     hkNativeDevice,
//     hkNativePage,
//     hkNativeStore,
//     hkNativeHttp,
//     hkNativeScan,
//     hkNativeBocr,
//     hkNativeBaudio
// }







